{"ast":null,"code":"var _jsxFileName = \"/data/messenger.client/src/pages/Home/Profile/index.tsx\",\n  _s = $RefreshSig$();\nimport React from 'react';\nimport { Home } from \"../../\";\nimport { Circle } from 'rc-progress';\nimport { observer } from \"mobx-react-lite\";\nimport { Context } from \"../../../index\";\nimport { profileCompletionPercentage } from \"../../../utils/User\";\nimport Switch from '@mui/material/Switch';\nimport { Button, UserProfile, Modal } from '../../../components';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst Profile = () => {\n  _s();\n  const {\n    store\n  } = React.useContext(Context);\n  const [profilePercent, setProfilePercent] = React.useState(0);\n  const [disableToggle, setDisableToggle] = React.useState(true);\n  const memoizedProfile = React.useMemo(() => profileCompletionPercentage(store.getProfile()),\n  // eslint-disable-next-line react-hooks/exhaustive-deps\n  [store.getProfile()]);\n  React.useEffect(() => {\n    setProfilePercent(memoizedProfile);\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [store.getProfile()]);\n  return /*#__PURE__*/_jsxDEV(Home, {\n    childrenFirst: /*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"messenger__sidebar-item\",\n      children: [/*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"messenger__sidebar-item-header\",\n        children: /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"messenger__sidebar-item-header-top\",\n          children: /*#__PURE__*/_jsxDEV(\"span\", {\n            children: \"\\u041D\\u0430\\u0441\\u0442\\u0440\\u043E\\u0439\\u043A\\u0438 \\u043F\\u0440\\u043E\\u0444\\u0438\\u043B\\u044F\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 32,\n            columnNumber: 29\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 31,\n          columnNumber: 25\n        }, this)\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 30,\n        columnNumber: 21\n      }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"messenger__sidebar-profile\",\n        children: [/*#__PURE__*/_jsxDEV(Circle, {\n          percent: profilePercent,\n          strokeWidth: 3,\n          className: \"messenger__sidebar-profile-progress\"\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 36,\n          columnNumber: 25\n        }, this), /*#__PURE__*/_jsxDEV(\"p\", {\n          className: \"messenger__sidebar-profile-progressInfo\",\n          children: [\"\\u041F\\u0440\\u043E\\u0444\\u0438\\u043B\\u044C \\u0437\\u0430\\u043F\\u043E\\u043B\\u043D\\u0435\\u043D \\u043D\\u0430: \", profilePercent.toString().slice(0, 5), \"%\"]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 41,\n          columnNumber: 25\n        }, this)]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 35,\n        columnNumber: 21\n      }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"messenger__sidebar-profileControl\",\n        children: [/*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"messenger__sidebar-profileControl-top\",\n          children: [/*#__PURE__*/_jsxDEV(Switch, {\n            checked: !disableToggle,\n            onChange: () => setDisableToggle(!disableToggle),\n            name: \"special\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 47,\n            columnNumber: 29\n          }, this), /*#__PURE__*/_jsxDEV(\"span\", {\n            className: \"messenger__sidebar-profileControl-top-toggleInfo\",\n            children: \"\\u0421\\u043F\\u0435\\u0446\\u0438\\u0430\\u043B\\u044C\\u043D\\u044B\\u0435 \\u0432\\u043E\\u0437\\u043C\\u043E\\u0436\\u043D\\u043E\\u0441\\u0442\\u0438\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 52,\n            columnNumber: 29\n          }, this)]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 46,\n          columnNumber: 25\n        }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"messenger__sidebar-profileControl-main\",\n          children: [/*#__PURE__*/_jsxDEV(Button, {\n            customClassName: \"messenger__sidebar-profileControl-changeProfile\",\n            fullWidth: false,\n            text: !disableToggle ? 'Изменить профиль' : '',\n            disable: disableToggle\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 57,\n            columnNumber: 29\n          }, this), /*#__PURE__*/_jsxDEV(Button, {\n            customClassName: \"messenger__sidebar-profileControl-deleteProfile\",\n            fullWidth: false,\n            text: !disableToggle ? 'Удалить профиль' : '',\n            disable: disableToggle,\n            callback: () => store.deleteProfileFromAPI()\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 63,\n            columnNumber: 29\n          }, this)]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 56,\n          columnNumber: 25\n        }, this)]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 45,\n        columnNumber: 21\n      }, this), /*#__PURE__*/_jsxDEV(Modal, {\n        active: true,\n        title: \"Удаление профиля\",\n        hasFunctionButtons: true,\n        children: /*#__PURE__*/_jsxDEV(\"div\", {\n          children: \"\\u0412\\u044B \\u0442\\u043E\\u0447\\u043D\\u043E \\u0445\\u043E\\u0442\\u0438\\u0442\\u0435 \\u0431\\u0435\\u0437\\u0432\\u043E\\u0437\\u0432\\u0440\\u0430\\u0442\\u043D\\u043E \\u0443\\u0434\\u0430\\u043B\\u0438\\u0442\\u044C \\u043F\\u0440\\u043E\\u0444\\u0438\\u043B\\u044C?\"\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 73,\n          columnNumber: 25\n        }, this)\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 72,\n        columnNumber: 21\n      }, this)]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 29,\n      columnNumber: 17\n    }, this),\n    childrenSecond: /*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"messenger__imProfile\",\n      children: store.getProfile().id && /*#__PURE__*/_jsxDEV(UserProfile, {\n        profile: store.getProfile()\n      }, void 0, false, {\n        fileName: _jsxFileName,\n        lineNumber: 79,\n        columnNumber: 51\n      }, this)\n    }, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 78,\n      columnNumber: 17\n    }, this)\n  }, void 0, false, {\n    fileName: _jsxFileName,\n    lineNumber: 27,\n    columnNumber: 9\n  }, this);\n};\n_s(Profile, \"Szrlz82K99UgRO51Wy1QQJLDjOw=\");\n_c = Profile;\nexport default _c2 = observer(Profile);\nvar _c, _c2;\n$RefreshReg$(_c, \"Profile\");\n$RefreshReg$(_c2, \"%default%\");","map":{"version":3,"names":["React","Home","Circle","observer","Context","profileCompletionPercentage","Switch","Button","UserProfile","Modal","Profile","store","useContext","profilePercent","setProfilePercent","useState","disableToggle","setDisableToggle","memoizedProfile","useMemo","getProfile","useEffect","toString","slice","deleteProfileFromAPI","id"],"sources":["/data/messenger.client/src/pages/Home/Profile/index.tsx"],"sourcesContent":["import React from 'react';\nimport {Home} from \"../../\";\nimport  {Circle} from 'rc-progress';\nimport {observer} from \"mobx-react-lite\";\nimport {Context} from \"../../../index\";\nimport {profileCompletionPercentage} from \"../../../utils/User\";\nimport Switch from '@mui/material/Switch';\nimport {Button, UserProfile, Modal} from '../../../components'\n\nconst Profile = () => {\n    const {store} = React.useContext(Context);\n    const [profilePercent, setProfilePercent] = React.useState<number>(0);\n    const [disableToggle, setDisableToggle] = React.useState(true);\n\n    const memoizedProfile = React.useMemo(\n        () => profileCompletionPercentage(store.getProfile()),\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n        [store.getProfile()]\n    );\n\n    React.useEffect(() => {\n        setProfilePercent(memoizedProfile);\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    },[store.getProfile()]);\n\n    return (\n        <Home\n            childrenFirst={\n                <div className=\"messenger__sidebar-item\">\n                    <div className=\"messenger__sidebar-item-header\">\n                        <div className=\"messenger__sidebar-item-header-top\">\n                            <span>Настройки профиля</span>\n                        </div>\n                    </div>\n                    <div className=\"messenger__sidebar-profile\">\n                        <Circle\n                            percent={profilePercent}\n                            strokeWidth={3}\n                            className=\"messenger__sidebar-profile-progress\"\n                        />\n                        <p className=\"messenger__sidebar-profile-progressInfo\">\n                            Профиль заполнен на: {profilePercent.toString().slice(0, 5)}%\n                        </p>\n                    </div>\n                    <div className=\"messenger__sidebar-profileControl\">\n                        <div className=\"messenger__sidebar-profileControl-top\">\n                            <Switch\n                                checked={!disableToggle}\n                                onChange={() => setDisableToggle(!disableToggle)}\n                                name=\"special\"\n                            />\n                            <span className=\"messenger__sidebar-profileControl-top-toggleInfo\">\n                                Специальные возможности\n                            </span>\n                        </div>\n                        <div className=\"messenger__sidebar-profileControl-main\">\n                            <Button\n                                customClassName=\"messenger__sidebar-profileControl-changeProfile\"\n                                fullWidth={false}\n                                text={!disableToggle?'Изменить профиль':''}\n                                disable={disableToggle}\n                            />\n                            <Button\n                                customClassName=\"messenger__sidebar-profileControl-deleteProfile\"\n                                fullWidth={false}\n                                text={!disableToggle?'Удалить профиль':''}\n                                disable={disableToggle}\n                                callback={() => store.deleteProfileFromAPI()}\n                            />\n                        </div>\n                    </div>\n                    <Modal active={true} title={\"Удаление профиля\"} hasFunctionButtons={true} >\n                        <div>Вы точно хотите безвозвратно удалить профиль?</div>\n                    </Modal>\n                </div>\n            }\n            childrenSecond={\n                <div className=\"messenger__imProfile\">\n                        {store.getProfile().id && <UserProfile profile={store.getProfile()} />}\n                </div>\n            }\n        />\n    );\n}\n\nexport default observer(Profile);"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,IAAI,QAAO,QAAQ;AAC3B,SAASC,MAAM,QAAO,aAAa;AACnC,SAAQC,QAAQ,QAAO,iBAAiB;AACxC,SAAQC,OAAO,QAAO,gBAAgB;AACtC,SAAQC,2BAA2B,QAAO,qBAAqB;AAC/D,OAAOC,MAAM,MAAM,sBAAsB;AACzC,SAAQC,MAAM,EAAEC,WAAW,EAAEC,KAAK,QAAO,qBAAqB;AAAA;AAE9D,MAAMC,OAAO,GAAG,MAAM;EAAA;EAClB,M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